package com.zmn.oms.third.hb114;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.List;

/**
 * 114号百渠道同步常量定义
 *
 * @author xiewenbing
 * @date  2020/08/12
 */
@Component
public class Haobai114Consts {

    /**
     * 渠道平台名称
     */
    public final static String CHANNEL_NAME = "114号百渠道";

    /**
     * 同步预约时间的http url path
     */
    public final static String SYNC_APPOINTTIME_PATH = "cspapi/order/update/info";

    /**
     * 需要同步的渠道id list
     */
    public final static List<Integer> CHANNEL_ID_LIST = Arrays.asList(32903,1195);

    /**
     * 同步的http url
     */
    public static String API_URL="http://nutirachel.qicp.vip/";

    /**
     * 判断是否为需要同步的114渠道
     * @param channelId
     * @return
     */
    public static boolean isHaobai114SyncChannel(Integer channelId) {
        return CHANNEL_ID_LIST.contains(channelId);
    }

    @Value("${hb114.api.url:http://116.228.55.172:9089/}")
    public void setApiUrl(String apiUrl) {
        API_URL = apiUrl;
    }
}
